package com.yonyou.pmclouds.workquality.service.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.workquality.entity.WorkqualityDetailVO;
import com.yonyou.pmclouds.workquality.entity.WorkqualityVO;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface WorkqualityQueryService {

    Map<String, Object> queryByCondition(String contidion, Integer start, Integer limit, byte enableStatus) throws BusinessException;

    WorkqualityVO queryByIDFull(String pk) throws BusinessException;

    WorkqualityVO queryByID(String pk) throws BusinessException;

    Map<String, WorkqualityVO> queryByIDs(String[] pks) throws BusinessException;

    WorkqualityVO queryByProcedure(String procedure);

    WorkqualityVO queryByProcedureAndType(String procedure, String checkType);

    List<WorkqualityVO> queryByVO(WorkqualityVO vo) throws BusinessException;
    
    List<WorkqualityVO> queryByChecktypes(String tenantId,int...checktypes) throws BusinessException;

    /**
     * 查询工序关联的检查标准
     *
     * @param procedure
     * @param checkType
     * @param tenantId
     * @return
     * @throws BusinessException
     */
    List<WorkqualityVO> queryWorkQualityByProcedureAndType(String procedure, String checkType, String tenantId) throws BusinessException;

    /**
     * 检查标准引用校验
     *
     * @param vo
     * @throws BusinessException
     */
    void referCheck(WorkqualityVO vo) throws BusinessException;

    WorkqualityDetailVO[] queryByProcedureCode(String pkTenant, String procedureCode);

    List<WorkqualityVO> queryByPkProcedures(Set<String> pkProcedures);

    List<WorkqualityDetailVO> queryDetailByPkQualities(Set<String> pkWorkQualities);

    /**
     * 通过id查询检查标准，移动端返回启用状态的检查项
     *
     * @param pk
     * @return
     * @throws BusinessException
     */
    WorkqualityVO queryByIDForMobile(String pk) throws BusinessException;

    Map<String, Map<String, List<WorkqualityVO>>> queryByProcedureIds(Set<String> pkProcedures) throws BusinessException;
}
